void main() {
  Man man = Man('Jack', 20);
  man.eat();
  man.drive();
  man.sing();

  Woman woman = Woman('Rose', 20);
  woman.eat();
  woman.dress();
  woman.sing();
  woman.dance();
}

class Person {
  Person(this.name, this.age);

  String? name;
  int? age;

  void eat() {
    print('$name go to eat; Today $age year old');
  }
}

// 男人
class Man extends Person with SingMixin {
  // super代表上一级
  Man(super.name, super.age);

  drive() {
    print('开车');
  }
}

// 女人
class Woman extends Person with SingMixin, DanceMixin {
  // super代表上一级
  Woman(super.name, super.age);

  dress() {
    print('打扮');
  }
}

// 角色
class Dancer extends Person with DanceMixin {
  // 构造函数
  Dancer(super.name, super.age);
}

// 混入
mixin SingMixin {
  sing() {
    print('唱歌');
  }
}

mixin DanceMixin {
  dance() {
    print('跳舞');
  }
}
